<?php 
$cond_vals = new stdClass();
$cond_vals->c = 't.parent_id = :v1';
$cond_vals->v = array(':v1' => SUPPORT_ID);
$tags = DbUtils::get($myPdo, TABLE_NAME_PREFIX_PLUGIN . 'art_tag', $cond_vals, NULL, NULL, NULL, NULL, NULL)->d;
foreach ($tags as $tag) {
  $cond_vals = new stdClass();
  $cond_vals->c .= "t.tag_ids LIKE :v1";
  $cond_vals->v = array('v1' => "%|$tag->id|%");
  $tag->_posts = DbUtils::get($myPdo, TABLE_NAME_PREFIX_PLUGIN . 'art_post', $cond_vals, 't.date', 'DESC', NULL, NULL, NULL)->d;
}
?>
<style>
table.help {
  width: 100%;
}
table.help td {
  vertical-align: top;
  text-align: left;
}
table.help td.main {
  width: 15%;
}
table.help a {
  font-family: Lucida Sans Unicode;
  color: #666;
}
table.help div {
  font-family: Lucida Sans Unicode;
  font-weight: bold;
}
table.help ul {
  padding: 0;
  margin: 0;
  margin-left: 10px;
  margin-top: 5px;
  list-style-type: none;
}
table.help li {
  margin: 0;
  padding: 3px 0;
}
table.help img {
  height: 120px;
}
</style>
<div>&nbsp;</div>
<table class="help" cellpadding=0 cellspacing=0>
  <tr>
    <td class="main" style="text-align: center;">
      <div>Verified By POZO</div>
      <img src="exts/uis/<?php echo $dirname; ?>/images/secure.png"></img>
    </td>
    <td style="padding: 0 10px;"><img src="exts/uis/<?php echo $dirname; ?>/images/line.jpg"></img></td>
    <td class="main">
      <div>Site Map</div>
      <ul>
        <?php foreach ($pages as $p) { ?>
          <?php if ($p->parent_id == 0 && $p->is_visible == 1) { ?>
          <li><a href="?i=<?php echo $p->id; ?>"><?php echo $p->title; ?></a></li>
          <?php }?>
        <?php } ?>
      </ul>
    </td>
    <td style="padding: 0 10px;"><img src="exts/uis/<?php echo $dirname; ?>/images/line.jpg"></img></td>
    <?php foreach ($tags as $idx => $tag) { ?>
    <td class="main">
      <div><?php echo $tag->name; ?></div>
      <ul>
        <?php foreach ($tag->_posts as $post) { ?>
          <li><a href="#" onclick="window.open('http://<?php echo URL . '?i=' . NEWS_ID . '&script=index_detail&art_id=' . $post->id . '&cat_id=' . TAG_HELP_ID; ?>')"><?php echo $post->title; ?></a></li>
        <?php } ?>
      </ul>
    </td>
    <?php if ($idx < (count($tags) - 1)) { ?>
    <td style="padding: 0 10px;"><img src="exts/uis/<?php echo $dirname; ?>/images/line.jpg"></img></td>
    <?php } ?>
    <?php } ?>
  </tr>
</table>
